package com.androidified.personalshopper.bean;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;


public class Commerce {

	private String id;
	private String publicName;
	private Address address;
	private double[] location;
	private List<Promotion> promotions;
	
	public Commerce() {
	}

	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getPublicName() {
		return publicName;
	}

	public void setPublicName(String publicName) {
		this.publicName = publicName;
	}

	public Address getAddress() {
		return address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	public double[] getLocation() {
		return location;
	}

	public void setLocation(double[] location) {
		this.location = location;
	}

	public List<Promotion> getPromotions() {
		return promotions;
	}

	public void setPromotions(List<Promotion> promotions) {
		this.promotions = promotions;
	}
	
	public void setPromotions(Promotion[] promotions) {
		if (promotions == null) {
			return;
		}
		
		this.promotions = new ArrayList<Promotion>();
		final int count = promotions.length;
		for (int i = 0; i < count; i++) {
			this.promotions.add(promotions[i]);
		}
	}


	@Override
	public String toString() {
		return "Commerce [id=" + id + ", publicName=" + publicName
				+ ", address=" + address + ", location="
				+ Arrays.toString(location) + ", promotions=" + promotions
				+ "]";
	}

	
}
